package com.museum.controller.impl;

import com.alibaba.fastjson.JSONObject;

import com.museum.base.BaseApiService;
import com.museum.base.BaseResponse;
import com.museum.controller.api.RoleApI;
import com.museum.entity.DTO.role.RoleAdd;

import com.museum.entity.DTO.role.RoleUpdate;
import com.museum.service.impl.RoleService;
import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;


/**
 * @Description:
 * @ClassName museum
 * @Author: yznl
 * @Date: 2020/12/5 19:17
 */
@RestController
@RequestMapping("/role")
public class RoleController extends BaseApiService<JSONObject> implements RoleApI {
    @Autowired
    private RoleService roleService;

    @Override
    public BaseResponse<JSONObject> getAllRole(HttpServletRequest request, Integer current, Integer limit) {

        return roleService.getAllRole(request,current,limit);
    }

    @Override
    public BaseResponse<JSONObject> addRole(HttpServletRequest request,RoleAdd roleAdd) {
        return roleService.addRole(request,roleAdd);
    }

    @Override
    public BaseResponse<JSONObject> deleteRole(Integer roleId) {
        return roleService.deleteRole(roleId);
    }

    @Override
    public BaseResponse<JSONObject> doAssign(RoleUpdate roleUpdate) {
        return roleService.doAssign(roleUpdate);
    }
}
